# !/usr/bin python3
# encoding: utf-8 -*-
# @file     : base_page.py
# @author   : 沙陌 Matongxue_2
# @Time     : 2023/9/5 20:30
# @Copyright: 北京码同学
from common.driver import DriverOperate
from common.file_load import load_yaml_file
from paths_manager import buyer_yaml, seller_yaml


class BasePage:

    def __init__(self):
        self.operate: DriverOperate = DriverOperate.globalDriverOperate   # DriverOperate operate 的类型，右边是类变量-这个是在fixture函数中已经赋值了


class BuyerBasePage(BasePage):
    def __init__(self):
        super().__init__()
        self.page_eles = load_yaml_file(buyer_yaml)[self.__class__.__name__]  #  读取yml文件，再根据key（调用者的类名） 来读取配置。字典-某个页面某个元素的选择器


class SellerBasePage(BasePage):
    def __init__(self):
        super().__init__()
        self.page_eles = load_yaml_file(seller_yaml)[self.__class__.__name__]


if __name__ == '__main__':
    b = BuyerBasePage()
    print(b.page_eles)